package com.neusoft.yuejian_01.base;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;


public abstract class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
        initEvents();
        initData();
    }

    protected abstract void initView();
    protected abstract void initEvents();
    protected abstract void initData();


    public int getUser_id()
    {
        SharedPreferences sp;
        sp =getSharedPreferences("userInfo", Context.MODE_PRIVATE);
        return sp.getInt("u_id",-1);

    }

    public int getC_id()
    {
        SharedPreferences sp;
        sp =getSharedPreferences("userInfo", Context.MODE_PRIVATE);
        return sp.getInt("c_id",-1);

    }

}

